package com.gltc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gltc.dao.PhotoAuthUserDao;
import com.gltc.entities.PhotoAuthUser;
import com.gltc.service.PhotoAuthUserService;

@Service
@Transactional
public class PhotoAuthUserServiceImpl implements PhotoAuthUserService {

	@Autowired
	private PhotoAuthUserDao userLogRegDao;
	
	/**
	 * 登录验证
	 */
	@Override
	public PhotoAuthUser checkLoginName(PhotoAuthUser userLogReg) {
		// TODO Auto-generated method stub
		
		return userLogRegDao.getUserByLoginNameAndPass(userLogReg);
	}

	/**
	 * 检验注册用户登录名是否唯一
	 */
	@Override
	public PhotoAuthUser getUserByLoginName(String username) {
		// TODO Auto-generated method stub
		return userLogRegDao.getUserByLoginName(username);
	}

	/**
	 * 注册
	 */
	@Override
	public boolean insertUser(PhotoAuthUser userLogReg) {
		// TODO Auto-generated method stub
		return userLogRegDao.insertUser(userLogReg);
	}

	/**
	 * 修改登录时间
	 */
	@Override
	public void updateUserLoginTime(int id, String formatDateTime) {
		// TODO Auto-generated method stub
		userLogRegDao.updateUserLoginTime(id,formatDateTime);
	}

}
